package mytankGame02;

public class tank {
    private int x;
    private int y;
    private int direction;
    private int speed = 1;
    private boolean is_alive = true;
    boolean is_touched = false;


    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public void setIs_alive(boolean is_alive) {
        this.is_alive = is_alive;
    }

    public int getSpeed() {
        return speed;
    }

    public boolean getIs_alive() {
        return is_alive;
    }

    public tank(int x, int y, int direction) {
        this.x = x;
        this.y = y;
        this.direction = direction;
    }
    public void moveUp(){
        y -= speed;
    }
    public void moveDown(){
        y += speed;
    }
    public void moveLeft(){
        x -= speed;
    }
    public void moveRight(){
        x += speed;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public void setX(int x) {
        this.x = x;
    }

    public void setY(int y) {
        this.y = y;
    }

    public void setDirection(int direction) {
        this.direction = direction;
    }

    public int getDirection() {
        return direction;
    }

}
